<?php


namespace app\admin\validate;


class Admin extends BaseValidate
{
    protected $rule = [
        'username' => 'require|unique:admin,username',
        'password' => 'require|length:6,12'
//        'role_id' => 'require|checkIDs'
    ];

    protected $message = [
        'username.require' => '管理员名字必填',
        'username.unique' => '管理员名字已存在',
        'password' => '密码是6到12位字符串或者数字的组合'
//        'role_id' => 'role_id参数必须是以逗号分隔的多个正整数'
    ];

    protected $scene = [
        'save' => ['username', 'password'],
        'update' => ['username', 'password'],
    ];
}